<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="author" content="VectorX">
    <meta name="keywords" content="线性渐变">
    <title>线性渐变</title>
    <style>
        .box1 {
            width: 200px;
            height: 200px;
            /* 线性渐变 */
            /* background-image: linear-gradient(to left, red, yellow); */
            /* background-image: linear-gradient(to right, red, yellow); */
            /* background-image: linear-gradient(to top, red, yellow); */
            /* background-image: linear-gradient(to bottom, red, yellow); */
            background-image: linear-gradient(45deg, red, yellow);
            /* background-image: linear-gradient(0.4turn, red, yellow);
            /* background-image: repeating-linear-gradient(red 0px, yellow 200px); */
        }
    </style>
</head>

<body>
    <div class="box1"></div>
</body>

</html>